<template>
    <div>
        <div>


<ly-b @abcdef="sss"></ly-b>

<br>
                --------------
<br>
            <div v-for="item,index in arr" :key="index">
                <h3>{{item.title}}</h3>
                <p>{{item.wenben}}</p>
                <span>发布时间：{{item.time}}</span>
                <button @click="delfun(index)">删除</button>
                <hr>
             </div>
        </div>
    </div>
</template>
<script>
import LyB from '../components/LyB.vue'

export default {
    data() {
        return {
            arr:[]
        }
    },
    components:{
        LyB
    },
    methods:{
        sss(n){
            this.arr.unshift(n)
            // console.log(n);
        },
        delfun(index){
            if( confirm('确认删除吗这条留言吗')==true){
                this.arr.splice(index,1)
            }else{
                return
            } 
        },

    }
}
</script>